home *** CD-ROM | disk | FTP | other *** search
- 'As requested, here is my set of CD32 Pad procedures. Feel free to use them
- 'for your own programs. The CD32 Pad procedure uses the same values as the
- 'Joy(X) command for the CD32_TEXT procedure, which allows you to use a
- 'standard joystick for entry as well.
-
- 'Test the test entry procedure
-
- Locate 0,0 : Print "Up/Down to select, Left to delete, Right to enter, Fire
- when done"
-
- CD32_TEXT[8,32,20] : TXT$=Param$
-
- Print "text entered: ";TXT$
- Wait 60
-
- 'Test the CD32 buttons
-
- Do
- PAD : CD32=Param
- Clw : Home
- If CD32 and 1 Then Print "Up ";
- If CD32 and 2 Then Print "Down ";
- If CD32 and 4 Then Print "Left ";
- If CD32 and 8 Then Print "Right ";
- If CD32 and 16 Then Print "Red ";
- If CD32 and 32 Then Print "Blue ";
- If CD32 and 64 Then Print "Green ";
- If CD32 and 128 Then Print "Yellow ";
- If CD32 and 256 Then Print "Rewind ";
- If CD32 and 512 Then Print "Fast Forward ";
- If CD32 and 1024 Then Print "Pause ";
- Loop
-
- Procedure PAD
- PAD:
- CD=0 : CD32=0
- Lib Open 3,"lowlevel.library",40
- Dreg(0)=1
- CD=Lib Call(3,-30)
- If CD and 1 Then CD32=CD32+%1000 : Rem Right
- If CD and 2 Then CD32=CD32+%100 : Rem Left
- If CD and 4 Then CD32=CD32+%10 : Rem Down
- If CD and 8 Then CD32=CD32+%1 : Rem Up
- If CD and 131072 Then CD32=CD32+%10000000000 : Rem Pause
- If CD and 262144 Then CD32=CD32+%100000000 : Rem Rewind
- If CD and 524288 Then CD32=CD32+%1000000000 : Rem Fast Forward
- If CD and 1048576 Then CD32=CD32+%1000000 : Rem Green
- If CD and 2097152 Then CD32=CD32+%10000000 : Rem Yellow
- If CD and 4194304 Then CD32=CD32+%10000 : Rem Red
- If CD and 8388608 Then CD32=CD32+%100000 : Rem Blue
- Lib Close 3
- End Proc[CD32]
-
- Procedure CD32_TEXT[TX,TY,IN]
- CHAR$="" : CHAR=0 : A$="" : IN$="" : PAD=0
-
- 'You can add characters to the set by including them in CHAR$
-
- CHAR$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.!?() 1234567890"
- CHAR=1
- Curs Off
- CD32:
-
- 'If you have added characters, make sure the 69 is set to the length of
- 'your character string.
-
- If CHAR<1 Then CHAR=69
- If CHAR>69 Then CHAR=1
- A$=Mid$(CHAR$,CHAR,1)
- B$=IN$+A$+" "
- Ink 7,0 : Text TX,TY,B$
- CD32A:
- Do : PAD=0 : PAD : PAD=Param : If PAD=0 Then Loop
-
- 'To use a joystick instead, replace the above line with:
- 'Do : PAD=Joy(0) : If PAD=0 Then Loop
-
- If Len(IN$)=IN Then Goto CD32A
- If PAD and 2 Then CHAR=CHAR-1 : Wait 5 : Goto CD32
- If PAD and 1 Then CHAR=CHAR+1 : Wait 5 : Goto CD32
- If PAD and 16
- IN$=IN$+A$
- Text TX,TY,IN$
- Goto CD32B
- End If
- If PAD and 4 Then IN$=Left$(IN$,Len(IN$)-1) : Wait 15 : Goto CD32
- If PAD and 8 Then IN$=IN$+A$ : Wait 10 : Goto CD32
- Goto CD32A
- CD32B:
- End Proc[IN$]
-
- 'TX and TY are graphic coordinates for the text. IN is the allowed length of
- 'the string to be entered. The text procedure returns the string as a
- parameter
- 'and uses the PAD procedure for its input.
-
- 'Up scrolls forward through the character set. Down scrolls back through the
- 'character set. Left deletes the current character. Right moves to the next
- 'character. Red (Fire) ends input.
-
- Well met and godspeed,
- Giark
- joehick@golden.net
- http://www.golden.net/~joehick/fbn/index.html
- ______ ______ _____ .------------------------------------------.
- / ____/ / __ / / ___ \ ! AMOS games, utilities, demos, etc. !
- / /__ / /_/ / / / / / ! !
- / ___/ / ___ | / / / / ! CyberSpace BBS (519)579-0072 !
- / / / /__/ / / / / / ! on A2000 060/50MHz (519)579-0173 !
- /_/ /______/ /_/ /_/ ! !
- Fly By Nite Videe-Oh! ! FBN Amiga 500 020 14MHz 1C/5F RAM 3.1OS !
- IAPA Member `------------------------------------------'
-
-
-